def screen_prime(n):
    candidates=[ [i+1,i%2==0 and True] for i in range(n) ]
    candidates[0][1]=False
    candidates[1][1]=True
    top=int(n**0.5+1)
    for i in range(1,top):
        if candidates[i][1]:
            prime=candidates[i][0]
            for j in range(2,n//prime+1):
                candidates[prime*j-1][1]=False
    results=[]
    for candidate in candidates:
        if candidate[1]:
            results.append(candidate[0])
    return results

def check_prime(n):
    results=[2]
    for i in range(2,n):
        number=i+1
        for j in range(2,number):
            if number%j == 0:
                break
        if j == number-1:
            results.append(number)
    return results

print(check_prime(100)==screen_prime(100))
